package cn.com.fattiger.framework.cms.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import cn.com.fattiger.framework.cms.admin.common.filter.LoginFilter;

/**
 * Created by Administrator on 2015/11/30.
 */
@Configuration
public class WebConfig {

    @Autowired
    LoginFilter loginFilter;

    @Bean
    public FilterRegistrationBean filterRegistrationBean(){
        FilterRegistrationBean frb = new FilterRegistrationBean();
        frb.setFilter(loginFilter);
        frb.setEnabled(true);
        frb.addUrlPatterns("*.do");

        //ServletRegistrationBean，FilterRegistrationBean，ServletListenerRegistrationBean

        return frb;
    }

    //public
}
